import { GameMapUtil } from "../../scene/map/GameMapUtil";
import { DateUtil } from "../../../common/tools/DateUtil";
import { Cache } from "../../cache/Cache";
import { ClockManager } from "../../manager/ClockManager";
import { EForce } from "../../../../Message/Public/EForce";
import { AttachedSoulBattlefieldTeamType } from "./AttachedSoulBattlefieldTeamType";
import { EEntityFightMode } from "../../../../Message/Public/EEntityFightMode";
import { GlobalStyle } from "../../../common/global/GlobalStyle";
import { GlobalClass } from "../../../../com/mui/core/GlobalClass";
import { ImagesConst } from "../../resource/ImagesConst";
type int = number;
//class AttachedSoulBattlefieldUtil
    
    export  class AttachedSoulBattlefieldUtil
    {
        

        public static showLightAndEffect(arg1: int): Boolean
        {
            return GameMapUtil.curMapState.isCrossSpiritWarCopyCode && (arg1 == 7181000 || arg1 == 7181004);
        }

        public static get isBattlefieldEnd(): Boolean
        {
            return DateUtil.getSecondsDis(Cache.instance.attachedSoulBattlefield.closeDt, ClockManager.instance.nowDate) >= -10 * 60;
        }

        public static getEntityForce(arg1: int): int
        {
            if (arg1 == EForce._EForceOne) 
            {
                return AttachedSoulBattlefieldTeamType.BLUE_TEAM;
            }
            return AttachedSoulBattlefieldTeamType.YELLOW_TEAM;
        }

        public static get isInAttachedSoulBattlefield(): Boolean
        {
            return GameMapUtil.curMapState.isCrossSpiritWarCopyCode && !(Cache.instance.role.entityInfo.fightModel == EEntityFightMode._EEntityFightModeObseve);
        }

        public static getForceColor(arg1: int, arg2: Boolean)
        {
            if (arg1 == Cache.instance.role.entityInfo.force) 
            {
                return arg2 ? GlobalStyle.color5Uint : GlobalStyle.color5;
            }
            return arg2 ? GlobalStyle.color7Uint : GlobalStyle.color7;
        }

        public static getBitmapDataByBuffers(arg1: Array<any>): Object /* flash.display.BitmapData */
        {
            if (arg1.indexOf(7181000) != -1) 
            {
                return GlobalClass.getBitmapData(ImagesConst.AttachedSoulBattlefieldSilverPoint);
            }
            if (arg1.indexOf(7181004) != -1) 
            {
                return GlobalClass.getBitmapData(ImagesConst.AttachedSoulBattlefieldGoldenPoint);
            }
            return null;
        }

        public static /* const */coolTime: int=2 * 60;

        public static /* const */fightTime: int=8 * 60 + 5;
    }
